/***
 * @description axios封装
 * @file api.ts
 * @author andy
 * @date 2024/3/22 16:40
 */
// file:api.s
// 1、导入axios以及拦截器
import service from "./request";

// demo接口1
export const demo1 = (data: any) => {
  return service({
    url: "/user/user/demo1/" + data,
    method: "post",
  });
};

//用户登录
export const adminLogin = (data: any) => {
  return service({
    url: "/user/index/adminLogin",
    method: "post",
    data,
  });
};
//用户登录
export const getUserList = (data: any) => {
  return service({
    url: "/user/index/getUserList",
    method: "post",
    data,
  });
};
//用户注册
export const Register = (data: any) => {
  return service({
    url: "/user/index/register",
    method: "post",
    data,
  });
};
//用户审核
export const checkUser = (data: any) => {
  return service({
    url: "/user/index/checkUser",
    method: "post",
    data,
  });
};
//用户审核
export const getMyInfoCheckUser = () => {
  return service({
    url: "/user/index/getMyInfo",
    method: "post",
  });
};
//修改用户信息
export const updateUser = (data: any) => {
  return service({
    url: "/user/index/updateUser",
    method: "post",
    data,
  });
};
//单个用户信息
export const deleteUser = (userId: any) => {
  return service({
    url: "/user/index/deleteUser/" + userId,
    method: "post",
  });
};
//批量删除
export const deleteUserBatch = (data: any) => {
  return service({
    url: "/user/index/deleteUserBatch",
    method: "post",
    data,
  });
};
//分页获取商品列表
export const getProdList = (data: any) => {
  return service({
    url: "/prod/index/getProdList",
    method: "post",
    data,
  });
};
//添加商品
export const addProd = (data: any) => {
  return service({
    url: "/prod/index/addProd",
    method: "post",
    data,
  });
};
//修改商品
export const updateProd = (data: any) => {
  return service({
    url: "/prod/index/updateProd",
    method: "post",
    data,
  });
};
//获取字典表数据
export const getDictList = (typeId: any) => {
  return service({
    url: "/prod/index/getDictList/" + typeId,
    method: "post",
  });
};
//删除商品
export const deleteProd = (prodId: any) => {
  return service({
    url: "/prod/index/deleteProd/" + prodId,
    method: "post",
  });
};
//获取当前用户的角色列表
export const getMyRoleList = () => {
  return service({
    url: "/user/index/getMyRoleList",
    method: "post",
  });
};
//获取当前用户的菜单列表
export const getUserMenuTree = () => {
  return service({
    url: "/user/index/getUserMenuTree",
    method: "post",
  });
};
//分页获取订单列表
export const getOrderList = (data: any) => {
  return service({
    url: "/order/index/getOrderList",
    method: "post",
    data,
  });
};
//分页获取订单列表
export const addOrder = (data: any) => {
  return service({
    url: "/order/index/addOrder",
    method: "post",
    data,
  });
};
//改变商品的状态
export const changeProdStatus = (data: any) => {
  return service({
    url: "/prod/index/changeProdStatus",
    method: "post",
    data,
  });
};
//日志分页列表
export const getLogList = (data: any) => {
  return service({
    url: "/user/log/getLogList",
    method: "post",
    data,
  });
};
